<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <title>title</title>
      <link rel="stylesheet" type="text/css" href="../../../css/api.css"/>
      <style>
          body{
            margin: 0
          }

                :focus{outline: none}
          h1,h2,h3,h4,h5,h6{font-weight: normal;}
          section .tx{display:block;width: 120px;height: 120px;box-sizing: border-box;border-radius: 50%;overflow: hidden;margin: 0 auto;margin-top: 30px;margin-bottom: 50px;}
            section .tx img{display: block;width: 100%}
          section .col{border-bottom: 1px solid #F5F5F5;height: 50px;position: relative;width: 100%;box-sizing: border-box;padding: 0 15px;}
          section .col *{line-height: 2em;color: #333}
          section .col input{display: block;;width: 100%;height: 50px;color: #999;padding-left:50px;box-sizing: border-box;padding-left: 70px;border: none;text-align: left;line-height: 50px;text-align: right;}
          section .col h3{position: absolute;left:15px;height: 50px;top:0;line-height: 30px;font-size:14px;}
          #inpu{width: 100%;padding: 0 14px;box-sizing: border-box;}
   #inpu input{display: block;width: 100%;text-align: center;;background-color: #fc8622;line-height:40px;height:40px;box-sizing: border-box;color: #fff;font-size: 13px;margin: 30px auto;-webkit-appearance: none;appearance: none;outline: none;border: none}
      </style>
  </head>
  <body>
    <section id="ewmshow" >
      <div  v-for="site in renwu">
      <span class="tx" style="margin-top:50px">
        <img :src="site.img" alt="">
      </span>
      <div class="col ">
    <h3 style=" text-align: center; width: 100% ;margin:50px 0;left:0">{{site.title}}</h3>
      </div>
      </div>
      <div class="col " style=" margin-top:100px">
          <h3>金额</h3><input type="tel" value=""  id="jine" placeholder="请输入您的金额，仅数字"  >
      </div>

      <div id="inpu" onclick="fabu()">
          <input type="submit" value="确认提交">
        </div>
    </section>

  </body>
  <script type="text/javascript" src="../../script/api.js"></script>
    <script type="text/javascript" src="../../script/vue.min.js"></script>
  <script type="text/javascript">
      apiready = function(){
        list = new Vue({
            el: '#ewmshow',
            data: {
              renwu:[{
                title:"王大仙",
                img:"../../image/ns.jpg",
              }]
            }
        })
id=api.pageParam.id


ajax();
      };
      var list,id;
    function fabu(){
      api.confirm({
          title: '确认提交？',
          buttons: ['确定', '取消']
      }, function(ret, err){
          if( ret ){
            console.log(ret.buttonIndex);
            if(ret.buttonIndex==1){
              ins_ajax();
            }

          }else{
               console.log( JSON.stringify( err ) );
          }
      });

    }


function ajax(){
  console.log(id);
  api.ajax({
      url: $api.getStorage("backapi")+'/index.php?s=jishou&c=home&m=show_ajax&uid='+id,
      method: 'get',
  },function(ret, err){
      if (ret) {
      list.renwu=ret.status.renwu;
      console.log(JSON.stringify(ret.status.renwu));
      } else {
          console.log( JSON.stringify( err ) );
      }
  });
}

function ins_ajax(){

console.log(111);
if(id==$api.getStorage("member")){
  api.toast({
      msg: '您的操作有误',
      duration: 2000,
      location: 'bottom'
  });

}else{
  api.ajax({
      url: $api.getStorage("backapi")+'/index.php?c=home&m=xiaofei',
      method: 'post',
      data: {
          values: {
              jifen:  $api.val($api.byId("jine")),
              uid:id,
              sid:$api.getStorage("member"),
          }
      }
  },function(ret, err){
      if (ret) {
        if(ret.status){
          api.toast({
              msg: '提交成功',
              duration: 2000,
              location: 'bottom'
          });
        setTimeout(function(){ api.closeWin()},1000);
        }
          console.log( JSON.stringify( ret ) );
      } else {
          console.log( JSON.stringify( err ) );
      }
  });



}



}

  </script>
  </html>
